package server;

import java.io.InputStream;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class LisServer {

    public LisServer() {
        try {
            //开启服务器，开放8088端口
            ServerSocket serverSocket = new ServerSocket(8087);
            while (true) {
                //监听端口，处于线程阻塞状态。如果有客服端连接到服务器，将连接信息封装成socket对象
                Socket socket = serverSocket.accept();
                new SocketThread(socket);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        new LisServer();
    }
}
